From 8d5f1ae6620dcf0d81d05c480fc4da194249d06b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 6 Mar 2019 16:55:27 -0500 Subject: [PATCH] gdk: Add crossing mode and detail to focus events We want focus events more similar to crossing events. --- gdk/gdkevents.c | 10 ++++++++++ gdk/gdkeventsprivate.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 3b0944d3cc..55b744d4f3 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -1980,6 +1980,11 @@ gdk_event_get_crossing_mode (const GdkEvent *event, *mode = event->crossing.mode; return TRUE; } + else if (event->any.type == GDK_FOCUS_CHANGE) + { + *mode = event->focus_change.mode; + return TRUE; + } return FALSE; } @@ -2006,6 +2011,11 @@ gdk_event_get_crossing_detail (const GdkEvent *event, *detail = event->crossing.detail; return TRUE; } + else if (event->any.type == GDK_FOCUS_CHANGE) + { + *detail = event->focus_change.detail; + return TRUE; + } return FALSE; } diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h index b81faba589..1c6756e60a 100644 --- a/gdk/gdkeventsprivate.h +++ b/gdk/gdkeventsprivate.h @@ -312,6 +312,8 @@ struct _GdkEventCrossing * @send_event: %TRUE if the event was sent explicitly. * @in: %TRUE if the surface has gained the keyboard focus, %FALSE if * it has lost the focus. + * @mode: the crossing mode + * @detail: the kind of crossing that happened * * Describes a change of keyboard focus. */ @@ -319,6 +321,8 @@ struct _GdkEventFocus { GdkEventAny any; gint16 in; + GdkCrossingMode mode; + GdkNotifyType detail; }; /* -- 2.30.2